<template>
  <div class="news">
    <div class="details-nav">
      <h1 class="title">{{ newsDetails.title }}</h1>
      <p class="time">
       {{ dayjs(newsDetails.created_at * 1000).format("YYYY-MM-DD") }}
      </p>
      <div class="rich-text" v-html="newsDetails.content"></div>
    </div>
  </div>
</template>
<script>
import { mapGetters, mapActions } from "vuex";
export default {
  name: "news",
  components: {},
  data() {
    return {};
  },
  mounted() {
    this.getDetail()
  },
  methods: {
    ...mapActions(["getNewsDetails"]),
    getDetail() {
      let data = {
        id: this.$route.query.id,
      };
      this.getNewsDetails(data);
    },
  },
  computed: {
    ...mapGetters(["newsDetails"]),
  },
};
</script>
<style scoped>
@import url("../../../assets/css/wap-list.css");
.details-nav .source {
  margin-right: 10px;
}
</style>